package com.drinks.yiniang.utils;

import com.drinks.yiniang.entity.user.address.DeliverAddressJson;

/**
 * @author han
 * @date 2019/12/4
 */
public class AddressUtils {

    public static String getDeliverAddress(DeliverAddressJson.DeliverRegionData province,
                                           DeliverAddressJson.DeliverRegionData city, DeliverAddressJson.DeliverRegionData district) {
        return province != null && province.getRegion_name() != null
                ? city != null && city.getRegion_name() != null
                ? district != null && district.getRegion_name() != null
                ? province.getRegion_name().equals(city.getRegion_name())
                ? province.getRegion_name() + " " + district.getRegion_name()
                : province.getRegion_name() + " " + city.getRegion_name() + " " + district.getRegion_name()
                : "" : "" : "";
    }
}
